package interaction;

import javax.media.j3d.BoundingSphere;
import javax.media.j3d.BranchGroup;
import javax.media.j3d.Canvas3D;
import javax.media.j3d.Transform3D;
import javax.media.j3d.TransformGroup;
import javax.vecmath.Vector3f;

import modell.DummySphere;

import com.sun.j3d.utils.behaviors.picking.PickRotateBehavior;
import com.sun.j3d.utils.geometry.ColorCube;

public class PickDummy extends BranchGroup{
	public PickDummy (Canvas3D canvas){
		TransformGroup objectRotate = null;
		Transform3D transform = new Transform3D();
		PickRotateBehavior pickRotate = null;
		BoundingSphere behaveBounds = new BoundingSphere();
		
		transform.setTranslation(new Vector3f(-0.6f, 0.0f, -0.6f));
		objectRotate = new TransformGroup(transform);
		
		objectRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
		objectRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
		objectRotate.setCapability(TransformGroup.ENABLE_PICK_REPORTING);
		
		this.addChild(objectRotate);
		objectRotate.addChild(new DummySphere(0.0f, 0.0f, 0.0f));
//		objectRotate.addChild(new ColorCube(0.5));
		
		pickRotate = new PickRotateBehavior(this, canvas, behaveBounds);
		this.addChild(pickRotate);
	}
}
